def runnian(y):
    return  y%400==0 or y%4==0 and y%100!=0

def yufen(y,m):
     tianshu=30
     if m==1 or m==3 or m==5 or m==7 or m==8 or m==10 or m==12:
         tianshu=31
     if m==2:
       tianshu=28
       if runnian(y):
          tianshu=29
     return tianshu
def jstianshu(y,m,d):
    tianshu=d
    if m>=2:
        if runnian(y):
            tianshu=tianshu+29
        else:
            tianshu = tianshu + 28
    if m>=3:
        tianshu=tianshu+31
    if m>=4:
        tianshu=tianshu+30
    if m>=5:
        tianshu=tianshu+31
    if m>=6:
        tianshu=tianshu+30
    if m>=7:
        tianshu=tianshu+31
    if m>=8:
        tianshu=tianshu+31
    if m>=9:
        tianshu=tianshu+30
    if m>=10:
        tianshu=tianshu+31
    if m>=11:
        tianshu=tianshu+30
    if m>=12:
        tianshu=tianshu+31
    return tianshu